package org.springframework.example.t0830.factory;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.example.t0830.scope.MyScopeHandler;
import org.springframework.stereotype.Component;

/**
 * 自定义scope作用域
 */
@Component
public class MyBeanFactoryPost implements BeanFactoryPostProcessor {
	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		beanFactory.registerScope("local",new MyScopeHandler());
	}
}
